#include"search.hpp"
#include<cstdio>
#include<string>
#include<iostream>
#include<cstring>
const std::string src_output="./data/raw_html";

int main()
{
    ns_search::Search*_search=new ns_search::Search();
    _search->InitSearch(src_output);

    std::string key;
    std::string json_string;
    char buffer[1024];
    while(true)
    {
        std::cout<<"请输入你要查询的关键词：";
        fgets(buffer,sizeof(buffer)-1,stdin);
        buffer[strlen(buffer)-1]=0;
        key=buffer;
        _search->Search_string(key,&json_string);
        std::cout<<json_string<<std::endl;
    }
    return 0;
    
}